from pml import Objects

class PMBooleanObject(Objects.PMIntegerObject.PMIntegerObject):
    def __init__(self, value=False):
        super().__init__()
        self.name = 'boolean'
        self.value = value
    def __repr__(self):
        return self.value.__repr__()
    def __hash__(self):
        return self.value.__hash__()

    def getObject(self):
        self.methods['__init__'] = self.tp_init
        self.methods['__print__'] = self.tp_print

        self.methods['__boolean__'] = self.tp_boolean

        return self

    @staticmethod
    def tp_init(frame, this, position, value):
        pass

    @staticmethod
    def tp_print(frame, this, position):
        pass

    @staticmethod
    def tp_boolean(frame, this, position):
        return Objects.object.PMTypeObject(PMBooleanObject(this.value))
